<h1>BitmapFill</h1>

<p>The BitmapFill data structure is used to fill a shape with an image. Four 
types of bitmap fill are supported:</p>

<table>

<tr>
<td valign="top">Clipped</td>
<td>If the area to be filled is larger than the image then the colour at the edge 
of the image is used to fill the remainder of the shape.</td>
</tr>

<tr>
<td valign="top">Tiled</td>
<td>If the area to be filled is larger than the image then the image is tiled 
to fill the area.</td>
</tr>

<tr>
<td valign="top">Unsmoothed Clipped</td>
<td>If the area to be filled is larger than the image then the colour at the edge 
of the image is used to fill the remainder of the shape.</td>
</tr>

<tr>
<td valign="top">Unsmoothed Tiled</td>
<td>If the area to be filled is larger than the image then the image is tiled 
without smoothing to fill the area.</td>
</tr>

</table>

<p>The unsmoothed styles were introduced in Flash 7 to provide a performance
improvement when displaying images.</p>


<table>

<tr>
<th nowrap>Field Name</th>
<th>Type</th>
<th>Size</th>
<th>Description</th>
</tr>

<tr>
<td nowrap valign="top">type</td>
<td nowrap valign="top">unsigned int</td>
<td nowrap valign="top" align="right">8</td>
<td>The type of bitmap fill, either Tiled (type=64), Unsmoothed Tiled (type=66),
Clipped (type=65) or Unsmoothed Clipped (type=66).</td>
</tr>

<tr>
<td nowrap valign="top">identifier</td>
<td nowrap valign="top">unsigned bit</td>
<td nowrap valign="top" align="right">16</td>
<td>The unique identifier of the image that will be displayed.</td>
</tr>

<tr>
<td nowrap valign="top">transform</td>
<td nowrap valign="top">CoordTransform</td>
<td nowrap valign="top" align="right">&nbsp;</td>
<td>The coordinate transform that will be applied to the image, to change its 
size, location relative to the origin of the shape, orientation, etc.</td>
</tr>

</table>

<p>When an image is loaded its width and height default to twips rather than 
pixels. An image 300 x 200 pixels will be displayed as 300 x 200 twips (15 x 
10 pixels). Scaling the image by 20 (20 twips = 1 pixel) using the coordinate 
transform will restore it to its original size.</p>

<p>The image is drawn with the top left corner placed at the origin (0, 0) of 
the shape being filled. Depending on how the shape is drawn the coordinate 
transform may also need to specify a translation to place the image at the 
desired location.</p>

<h1 class="datasheet">When To Use</h1>

<p>In addition to filling shapes with images that represent textures or complex 
fill patterns a BitmapFill is required to display any image in a Flash file - 
image can only be displayed in Flash inside a shape definition. The instructions
that define images only contain the image data, not how it is displayed. To simply 
display an image, the selected line style of a shape may be set to zero so that 
the image is displayed without a border.</p>

<h2>History</h2>

<p>BitmapFill represents the FillStyle structure from the Macromedia Flash (SWF) 
File Format Specification. It was introduced in Flash 1. The Unsmoothed fill
styles were introduced in Flash 7.</p>
